package ar.edu.caece.dns.modelo.socket;

import java.net.Socket;

import ar.edu.caece.dns.modelo.servidor.Servidor;
import ar.edu.caece.dns.modelo.servidor.impl.ServidorImpl;
import junit.framework.TestCase;

public class RequestControllerBuilderTestCase extends TestCase {

	public RequestControllerBuilderTestCase(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testWithSocket() {
		RequestControllerBuilder builder = new RequestControllerBuilder();

		assertEquals(builder, builder.with(new Socket()));
	}

	public void testWithServidor() {
		RequestControllerBuilder builder = new RequestControllerBuilder();

		assertEquals(builder, builder.with(new ServidorImpl()));
	}

	public void testBuild() {
		Socket socket = new Socket();
		Servidor servidor = new ServidorImpl();
		RequestControllerBuilder builder = new RequestControllerBuilder();

		builder.with(servidor).with(socket);

		RequestController controller = builder.build();

		assertNotNull(controller);
	}

}
